<!doctype html>
<html>
<head>
	<meta charset="utf-8">
	<title>标题</title>
	<meta name="keywords" content="">
	<meta name="description" content="">
	<meta name="viewport" content="width=device-width,minimum-scale=0.5,maximum-scale=1.0,initial-scale=1.0,user-scalable=no" />
	<script src="./js/zepto.js"></script>
	<script src="./js/rem.js"></script>
	<script src="./js/touch.min.js"></script>
	<script src="./js/laytpl.js"></script>
	<link rel="stylesheet" href="./css/about.css" />
</head>
<body>
	<section>
		<div class="main" style="background:none">
			
			<div class="shop-mess" id="goodswrapper">
				<!-- <div class="shop-serve">
					<ul class="show-content-list">
						<li class="title">商家服务</li>
						<li>每周都有一款特价商品</li>
						<li>每周都有一款特价商品</li>
					</ul>
				</div> -->
				
			</div>
		</div>
	</section>
	<script type="text/html" id="goodscontent">
		<div class="shop-detail-mess">
			<ul class="show-content-list">
				<!--<li class="title">
					{{d.title}}
				</li>-->
				<li style="border-bottom:none;line-height:0.5rem;">
					<p>{{d.content}}</p>
				</li>
				
				
			</ul>
		</div>
	</script>
</body>
<script>
	function formatTemplate(dta, tmpl) {  
        var b;
        var format = { 
            price: function(x) {  
                // console.log(typeof x,this.discount);
                return (x*b).toFixed(2); 
            },
            discount:function(a){
                b=a==0?1:a*0.1;
                return b;
            }
        };  
        return tmpl.replace(/{(\w+)}/g, function(m1, m2) {  
            if (!m2)  
                return "";  
            return (format && format[m2]) ? format[m2](dta[m2]) : dta[m2];  
        });  
    }
	function request(method,url,fun,data){
    	// console.log(url);
        data=data||{};
        url+="?v="+new Date().getTime();
    	$.ajax({
    		type:method,
		   	url:url,
		   	data:data||{date:new Date().getTime()},
		   	success: function(msg){
				if(fun){
                    fun(msg);
                    }  		 	
		   },
       error:function(e){
         console.log(JSON.stringify(e));
        
            }
        })
		
    }

    var arr=location.href.split('?');

    var id=arr?arr[1].split('=')[1]:0;

    request('get','/api/article/detail',function(data){
    	console.log(data)
    	if(data.code==200){
    		var goodso=data.data.cnt;
    		$('#goodswrapper').html('');
    		var tpl=goodscontent.innerHTML;
    		laytpl(tpl).render(goodso,function(html){
    			$('#goodswrapper').append(html);
    		})
    	}
    },{id:id})

		
</script>
</html>